package arrays

func MapInt(arr []int, call func(index, val int) interface{}) []interface{} {
	result := make([]interface{}, len(arr))
	for i, val := range arr {
		result[i] = call(i, val)
	}
	return result
}

func MapString(arr []string, call func(index int, val string) interface{}) []interface{} {
	result := make([]interface{}, len(arr))
	for i, val := range arr {
		result[i] = call(i, val)
	}
	return result
}

func MapFloat64(arr []float64, call func(index int, val float64) interface{}) []interface{} {
	result := make([]interface{}, len(arr))
	for i, val := range arr {
		result[i] = call(i, val)
	}
	return result
}

func Map(arr []interface{}, call func(index int, val interface{}) interface{}) []interface{} {
	result := make([]interface{}, len(arr))
	for i, val := range arr {
		result[i] = call(i, val)
	}
	return result
}
